import request from '../utils/axios';
import qs from "qs";

//通知数据
export function noticeData(param) {
    return request({
        url: '/notice?' + qs.stringify(param),
        method: 'get',
    })
}

//删除通知
export function deleteNotice(id) {
    return request({
        url: '/notice/delete/' + id,
        method: 'delete',
    })
}

//根据编号查询通知信息
export function noticeById(id) {
    return request({
        url: '/notice/' + id,
        method: 'get',
    })
}

//添加
export function add(data) {
    return request({
        url: '/notice/add?' + qs.stringify(data),
        method: 'post',
    })
}


//批量删除
export function batchDelete(ids) {
    return request({
        url: '/notice/batchDelete/' + ids,
        method: 'delete',
    })
}

//MavonEditor上传图片
export const uploadImg = (params) => {
    return request({
        method: 'post',
        url: `/notice/uploadImg`,
        data: params,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    });
}

//查询通知公告
export function noticeType() {
    return request({
            method: 'post',
            url: `/notice/noticeType`,
        }
    )
}

// 导出通知公告信息
export function exportNotice() {
    return request({
        url: '/notice/export',
        method: 'get',
        procgress: true,
        responseType: 'blob'
    })
}

